package com.bilicraft.plugin.explode;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.configuration.file.FileConfiguration;

public class BEConfig{
	public static String success = null;
	public static String invalid = null;
	public static String nothing = null;
	public static Map<Integer,String> exMap = new HashMap<Integer, String>();
	public static ArrayList<String> exRecipe = new ArrayList<String>();
	
	public static void setAll(FileConfiguration fc){
		try{
			success = (String) fc.getConfigurationSection("tips").get("success");
			invalid = (String) fc.getConfigurationSection("tips").get("invalid");
			nothing = (String) fc.getConfigurationSection("tips").get("nothing");
		}catch(Exception e){
			e.printStackTrace();
		}
		ArrayList<String> al = (ArrayList<String>) fc.get("explodes");
		BEConfig.exMap = new HashMap<Integer, String>();
		for(String ali:al){
			try{
				String alis[] = ali.split(":");
				BEConfig.exMap.put(Integer.valueOf(alis[0]), alis[1]);
			}catch(Exception e){
				e.printStackTrace();
			}
		}
		exRecipe = (ArrayList<String>) fc.get("recipes");
	}
}
